#include <stdio.h>
#include <sys/msg.h>
#include <unistd.h>
#include <string.h>

struct msgbuf {
               long mtype;       /* message type, must be > 0 */
               char mtext[512];    /* message data */
           };


int main(){
    int q_id = msgget(0x12121212, IPC_CREAT | 0664);
    if(q_id < 0){
        perror("msgget");
        return 0;
    }
    printf("q_id : %d\n", q_id);

    struct msgbuf mb;
    mb.mtype = 1;
    strcpy(mb.mtext, "x");
    msgsnd(q_id, &mb, sizeof(mb.mtext), IPC_NOWAIT);


    return 0;
}
